package com.merry.rsautils;

import com.merry.rsautils.utils.RsaUtils;
import com.merry.rsautils.vo.Entity1;
import com.merry.rsautils.vo.SubEntity1;

import java.util.ArrayList;
import java.util.List;

public class RsaTest {
    public static void main(String[] args) throws Exception {
        SubEntity1 subEntity1 = new SubEntity1();
        subEntity1.setId("ididid");
        subEntity1.setName("名字不加密哦");
        subEntity1.setPassword("password111");

        SubEntity1 subEntity2 = new SubEntity1();
        subEntity2.setId("idididid");
        subEntity2.setName("名字不加密哦");
        subEntity2.setPassword("password11122");
        SubEntity1 subEntity3 = new SubEntity1();
        subEntity3.setId("idididididid");
        subEntity3.setName("名字不加密哦");
        subEntity3.setPassword("password111333");
        List<SubEntity1> list =new ArrayList<>();
        list.add(subEntity2);
        list.add(subEntity3);

        Entity1 entity1 = new Entity1();
        entity1.setIdcard("idcard");
        entity1.setTel("13012341234");
        entity1.setSubEntity1(subEntity1);
        entity1.setSubEntity1s(list);
        System.out.println("加密前"+entity1);
        RsaUtils.rsaObject(entity1,Entity1.class);
        System.out.println("加密后"+entity1);
    }
}
